<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../babel.min.js"></script>
    <script src="../react.development.js"></script>
    <script src="../react-dom.development.js"></script>
    <title>列表Key的使用</title>
</head>

<body>
    <div id="root"></div>
    <script type="text/babel">
        function AbcItem(props){
            return <h1>{props.value}</h1>
        }
        function AbcList(props) {
            const items = props.items
            const listItems = items.map((it) =><AbcItem value={it} key={it}/>)
            return <ul>{listItems}</ul>
        }
        const items = ["one","two","three","four","five","six","seven","eight","nine","ten","1",1]
        ReactDOM.render(<AbcList items={items}/>,document.getElementById("root"))
    </script>

</body>

</html>